package net.orange.console.controller;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

/**
 * The system information managed bean using in JSF MVC modal. it is include the
 * web page content and control the action and page forward direction in the web
 * site.
 */
@ManagedBean(name="system")
@SessionScoped
public class SystemInformationController {

	/**
	 * @return the system total memory.
	 */
	public long getTotalMemory() {
		return Runtime.getRuntime().totalMemory();
	}

	/**
	 * @return the system free memory
	 */
	public long getFreeMemory() {
		return Runtime.getRuntime().freeMemory();
	}

	/**
	 * @return the system max memory
	 */
	public long getMaxMemory() {
		return Runtime.getRuntime().maxMemory();
	}

	/**
	 * @return Java Runtime Environment version
	 */
	public String getJava_Version() {
		return System.getProperties().getProperty("java.version");
	}

	/**
	 * @return Java Runtime Environment vendor
	 */
	public String getJava_Vendor() {
		return System.getProperties().getProperty("java.version");
	}

	/**
	 * @return Java vendor URL
	 */
	public String getJava_Vendor_Url() {
		return System.getProperties().getProperty("java.vendor.url");
	}

	/**
	 * @return Java installation directory
	 */
	public String getJava_Home() {
		return System.getProperties().getProperty("java.home");
	}

	/**
	 * @return Java Virtual Machine specification version
	 */
	public String getJava_Vm_Specification_Version() {
		return System.getProperties().getProperty(
				"java.vm.specification.version");
	}

	/**
	 * @return Java Virtual Machine specification vendor
	 */
	public String getJava_Vm_Specification_Vendor() {
		return System.getProperties().getProperty(
				"java.vm.specification.vendor");
	}

	/**
	 * @return Java Virtual Machine specification name
	 */
	public String getJava_Vm_Specification_Name() {
		return System.getProperties().getProperty("java.vm.specification.name");
	}

	/**
	 * @return Java Virtual Machine implementation version
	 */
	public String getJava_Vm_Version() {
		return System.getProperties().getProperty("java.vm.version");
	}

	/**
	 * @return Java Virtual Machine implementation vendor
	 */
	public String getJava_Vm_Vendor() {
		return System.getProperties().getProperty("java.vm.vendor");
	}

	/**
	 * @return Java Virtual Machine implementation name
	 */
	public String getJava_Vm_Name() {
		return System.getProperties().getProperty("java.vm.name");
	}

	/**
	 * @return Java Runtime Environment specification version
	 */
	public String getJava_Specification_Version() {
		return System.getProperties().getProperty("java.specification.version");
	}

	/**
	 * @return Java Runtime Environment specification vendor
	 */
	public String getJava_Specification_Vendor() {
		return System.getProperties().getProperty("java.specification.vendor");
	}

	/**
	 * @return Java Runtime Environment specification vendor
	 */
	public String getJava_Specification_Name() {
		return System.getProperties().getProperty("java.specification.name");
	}

	/**
	 * @return Java class format version number
	 */
	public String getJava_Class_Version() {
		return System.getProperties().getProperty("java.class.version");
	}

	/**
	 * @return Java class path
	 */
	public String getJava_Class_Path() {
		return System.getProperties().getProperty("java.class.path");

	}

	/**
	 * @return List of paths to search when loading libraries
	 */
	public String getJava_Library_Path() {
		return System.getProperties().getProperty("java.library.path");
	}

	/**
	 * @return Default temp file path
	 */
	public String getJava_Io_Tmpdir() {
		return System.getProperties().getProperty("java.io.tmpdir");
	}

	/**
	 * @return Name of JIT compiler to use
	 */
	public String getJava_Compiler() {
		return System.getProperties().getProperty("java.compiler");
	}

	/**
	 * @return Path of extension directory or directories
	 */
	public String getJava_Ext_Dirs() {
		return System.getProperties().getProperty("java.ext.dirs");
	}

	/**
	 * @return Operating system name
	 */
	public String getOs_Name() {
		return System.getProperties().getProperty("os.name");
	}

	/**
	 * @return Operating system architecture
	 */
	public String getOs_Arch() {
		return System.getProperties().getProperty("os.arch");
	}

	/**
	 * @return Operating system version
	 */
	public String getOs_Version() {
		return System.getProperties().getProperty("os.version");
	}

	/**
	 * @return File separator ("/" on UNIX)
	 */
	public String getFile_Separator() {
		return System.getProperties().getProperty("file.separator");
	}

	/**
	 * @return Path separator (":" on UNIX)
	 */
	public String getPath_Separator() {
		return System.getProperties().getProperty("path.separator");
	}

	/**
	 * @return Line separator ("\n" on UNIX)
	 */
	public String getLine_Separator() {
		return System.getProperties().getProperty("line.separator");
	}

	/**
	 * @return Line separator ("\n" on UNIX)
	 */
	public String getUser_Name() {
		return System.getProperties().getProperty("user.name");
	}

	/**
	 * @return User's home directory
	 */
	public String getUser_Home() {
		return System.getProperties().getProperty("user.home");
	}

	/**
	 * @return User's current working directory
	 */
	public String getUser_Dir() {
		return System.getProperties().getProperty("user.dir");
	}
}
